﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/content.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户信息管理</title>
<script>
$(document).ready(function(){
	if($.browser.msie)
		window.attachEvent('onbeforeunload',function(){$("#submitButton").val("请等待").attr("disabled","true");});
	else//在chrome中不起作用
 		window.addEventListener('onbeforeunload',function(){$("#submitButton").val("请等待").attr("disabled","true");});
 		
		$("#name").focus();
		$("#userForm").validate({
			 rules: { 
				name: { 
        			required: true, 
        			maxlength:12
    			},
    			area: {
    				required: true,
    				maxlength:12
    			},
    			workunit: {
    				required: true,
    				maxlength:50
    			},    			
    			workphone:
    			{
    				isPhoneCall: true,
    				maxlength:50
    			},
    			address: {
                    required: true, 
        			maxlength:30
    			},
            	email: {
                    email: true, 
        			maxlength:25
    			},
        	    fax:{
        	    	isPhoneCall: true,
        	    	maxlength:25
				},
            	mobile: {
                    isPhoneCall: true,
			        maxlength:50
        	    }
			},
			success: function(label) {
				label.html("&nbsp;").addClass("checked");
	        }	
		});
	});		
 </script>
	</head>
	<body>
 	 <div class="rhead">
 	 	  <div class="rpos">当前位置: 用户管理  - 编辑用户信息</div>
 	 	  <div class="ropt"><input type="button" value="返回" onclick="history.back()"/></div>
  	</div>
		<form action="usersAction!update.action" method="post" id="userForm"
		 name="userForm"  enctype="multipart/form-data">
			<input type="hidden" name="id" value="${tusers.id}"/>
		<table  align="center" class="listTable3" width="90%">
			<tr>
				<td class="pn-flabel" width="100px">用户名</td><td>${tusers.loginName}
				<input type="hidden" name="loginName" value="${tusers.loginName}"/>
				</td>
				
			</tr>
			<tr>
				<td class="pn-flabel">真实名字</td><td><input type="text" name="name" 
				value="${tusers.name}"/></td>
			</tr>
			<tr>
			  <td class="pn-flabel">所属角色</td>
			  <td>
			      <c:forEach var="rolesList" items="${rolesList}">
			      	<c:if test="${((rolesList.id==3 && users.id==1) or rolesList.id!=3)&&isAdmin!=2}">
						<input type="checkbox" value="${rolesList.id}" name="checkmenu"
							<c:forEach var="usersRolesList" items="${usersRolesList}">
									<c:if test="${usersRolesList.roles.id==rolesList.id}">
										checked
									</c:if>
							</c:forEach>
						/>${rolesList.name}&nbsp;&nbsp;
						</c:if>
					
					<c:if test="${isAdmin==2&&rolesList.id==4}">
						<input type="checkbox" value="${rolesList.id}" name="checkmenu"
							<c:forEach var="usersRolesList" items="${usersRolesList}">
									<c:if test="${usersRolesList.roles.id==rolesList.id}">
										checked
									</c:if>
							</c:forEach>
						/>${rolesList.name}&nbsp;&nbsp;
						</c:if>					
				  </c:forEach>
			  </td>
			</tr>
			<tr>
				<td class="pn-flabel">工作单位</td><td><input type="text" name="workunit" value="${tusers.workunit}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">地区</td><td><input type="text" name="area" value="${tusers.area}" /></td>
			</tr>	
			<tr>
				<td class="pn-flabel">地址</td><td><input type="text" name="address"  value="${tusers.address}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">联系电话</td><td><input type="text" name="workphone" value="${tusers.workphone}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">传真号码</td><td><input type="text" name="fax" value="${tusers.fax}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">联系E-mail</td><td><input type="text" name="email" value="${tusers.email}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">移动电话</td><td><input type="text" name="mobile" value="${tusers.mobile}"/></td>
			</tr>
			<tr>
				<td class="pn-flabel">状态</td>
				<td>
					<select name="state">
						<option value="1">已启用</option>
						<option value="0" <c:if test="${tusers.state==0}">selected</c:if>><font color="red">已停用</font></option>
					</select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td  align="center" >
				<input type="submit" id="submitButton" value=" 提 交 "/>
				</td>
			</tr>
	 	</table>
	</form>
	</body>
</html>

